package cn.bone;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.boot.web.context.WebServerPortFileWriter;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;


@SpringBootApplication
@EnableTransactionManagement
@EnableAsync
@EnableCaching
@EnableWebMvc
@EnableScheduling
public class OuMain {

    public static void main(String... args) {
        SpringApplication app = new SpringApplication(OuMain.class);
        app.addListeners(new ApplicationPidFileWriter("logs/ou.pid"));
        app.addListeners(new WebServerPortFileWriter("logs/ou.port"));
        ConfigurableApplicationContext context = app.run(args);
        System.out.println("--->> 项目启动成功! <<---");

//        String[] names = context.getBeanDefinitionNames();
//        for(String name : names){
//            System.out.println(name);
//        }
    }
}
